package leetcode.code2317;

public class Solution {
	public int maximumXOR(int[] nums) {
		int ans = 0;
		for (int i = 0; i < nums.length; i++) {
			int num = nums[i];
			int p = 0;
			while (num > 0) {
				if ((num & 1) == 1) {
					ans |= (1 << p);
				}
				num >>= 1;
				p++;
			}
		}
		return ans;
	}
}
